package com.lambkit.module.upms.shiro;

import java.util.Collection;
import java.util.Collections;

import org.apache.shiro.cache.CacheManager;
import org.apache.shiro.realm.Realm;
import org.apache.shiro.session.SessionListener;
import org.apache.shiro.session.mgt.eis.SessionDAO;

import com.lambkit.component.shiro.AbstractLambkitShiroConfigService;
import com.lambkit.module.upms.client.shiro.UpmsRealm;

public class UpmsLambkitShiroConfigService extends AbstractLambkitShiroConfigService {

	@Override
	public Realm createRealm() {
		// TODO Auto-generated method stub
		return new UpmsRealm();
	}

	@Override
	public SessionDAO createShiroSessionDao() {
		// TODO Auto-generated method stub
		return new ShiroCacheSessionDao();
	}

	@Override
	public CacheManager createCacheManager() {
		// TODO Auto-generated method stub
		return new ShiroCacheManager();
	}
	
	@Override
	public Collection<SessionListener> createListeners() {
		// TODO Auto-generated method stub
		ShiroSessionListener sessionListener = new ShiroSessionListener();
		return Collections.singleton(sessionListener);
	}

}
